/**
 * 
 */
package aaaAddr;

import java.util.List;

 

import org.apache.http.impl.io.DefaultHttpRequestWriterFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;

import com.attilax.io.filex;
import com.attilax.io.pathx;

/**
 * aaaAddr.Neteasy163Login
 * 
 * @author attilax 2016年4月25日 下午6:07:38
 */
public class Neteasy163Login {
//	public static void main(String[] args) {
//		
//	}

	/**   Neteasy163Login
	 * attilax 2016年4月25日 下午6:07:38
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("0220");
 
		//org.apache.http.impl.io.DefaultHttpRequestWriterFactory
		//  org.apache.http.impl.io.DefaultHttpRequestWriterFactory
		// DefaultHttpRequestWriterFactory C:\0workspace 空格\AtiPlatf_auto\dic
		 // DefaultHttpRequestWriterFactory
		List<String> li = filex.read2list("$root$/dic/163.txt");
		for (String line : li) {
			String[] a = line.split(",");
			String name = a[0];
			String pwd = a[1];
			String pubUrl = "http://email.163.com/";
			String ffpath = pathx.webAppPath()
					+ "\\Mozilla Firefox\\firefox.exe";
			System.setProperty("webdriver.firefox.bin", ffpath);
			FirefoxDriver driver = null;
			driver = new FirefoxDriver();
			driver.get(pubUrl);
			driver.findElement(By.id("userNameIpt")).clear();
			driver.findElement(By.id("userNameIpt")).sendKeys(name);
//			driver.findElement(By.id("mVcodeIpt")).clear();
//			driver.findElement(By.id("mVcodeIpt")).sendKeys("1857");
//			driver.findElement(By.id("sendAcodeBtn")).click();
//			driver.findElement(By.id("sendAcodeStg")).click();

			driver.findElement(By.id("pwdInput")).clear();
			driver.findElement(By.id("pwdInput")).sendKeys(pwd);
		 
				 
			break;
		}

	}

}
